<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>放大图</title>
</head>
<style>
    .big{
        width: 415px;
        height: 400px;
    }
    .small>img{
        width: 100px;
        height: 100px;
    }
</style>
<body>
    <div >
        <img src="./imgs/1.jpg" alt="" class="big">
    </div>
    <div class="small">
        <img src="./imgs/1.jpg" alt="">
        <img src="./imgs/2.jpg" alt="">
        <img src="./imgs/3.jpg" alt="">
        <img src="./imgs/4.jpg" alt="">
    </div>

    <script>
            let  img = document.getElementsByTagName('img');
            for (let i = 0; i < img.length; i++) {
                img[i].onmouseover = function(){
                    img[0].src = img[i].src;
                    this.style.border = '2px solid #ccc' 
                img[i].onmouseout = function(){

                    this.style.border =" 10px solid #ddd"
                }

                }
                
            }

    </script>
</body>
</html>